Skip to content

Remove stale Vulkan compile gates and legacy OpenGL cvar wiring#253

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/feature-flag-cleanup-0e57
Draft

Remove stale Vulkan compile gates and legacy OpenGL cvar wiring#253
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/feature-flag-cleanup-0e57

Conversation

@cursor

@cursor cursor Bot commented Jun 10, 2026

Copy link
Copy Markdown

Flags removed

Flag / gate Why safe to delete
USE_VK_PBR #else branch in vk_shader_modules.c USE_VK_PBR is unconditionally #defined in tr_local.h for Vulkan; the non-PBR shader init path was unreachable dead code (~120 lines).
USE_TESS_NEEDS_NORMAL / USE_TESS_NEEDS_ST2 compile gates Both macros were commented out in tr_local.h (permanently off). Unwrapping #ifdef guards preserves current behavior: normals and ST2 are always tessellated on surface paths.
USE_VBO_GRID compile gate Always defined when USE_VBO is on (also always on). Grid surfaces always use the VBO fast path; the #ifdef added noise without a live off-path.
Unconditional r_allowSoftwareGL / r_glDriver registration Vulkan-only builds no longer register legacy OpenGL cvars. Registration and SDL GLimp references are gated behind USE_OPENGL_API (still available for MSVC/OpenGL-capable builds).

Not removed (low confidence)

  • r_renderMode — Now wired for deferred G-buffer (r_renderMode 1) and Forward+ latch (r_renderMode 2) via tr_render_mode_vk.c; prior cleanup attempt was outdated.
  • Runtime toggles with real off-paths: r_forwardPlus, r_vbo, r_pbr, r_volumetricFog, RTX cvars.

Behavioral parity checks

  • ./scripts/compile_engine.sh vulkanpass (Release build, client/server/Vulkan renderer copied to release/).
  • bash tests/scripts/test_vulkan_regression_source_guards.shpass (new guards pin PBR-only shader init, absent USE_VBO_GRID/USE_TESS_NEEDS_* macros).
  • bash scripts/q3_openarena_compat_check.shpass (14/14, including new USE_OPENGL_API gate check for r_allowSoftwareGL).
Open in Web View Automation 

- Drop dead non-PBR shader init fallback in vk_shader_modules.c (USE_VK_PBR
  is always defined for the Vulkan renderer).
- Remove unused USE_TESS_NEEDS_* and USE_VBO_GRID compile gates; grid VBO
  path and unconditional normal/ST2 tessellation are now the only path.
- Gate r_allowSoftwareGL/r_glDriver registration behind USE_OPENGL_API on
  Vulkan-only client builds; SDL GLimp only references them when OpenGL is
  compiled in.
- Extend regression/compat guards to prevent reintroducing removed flags.

Co-authored-by: Tim Fox <timfox@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant